import { http } from "@/utils/http";
import { baseUrlApi, filerEmptyVal } from "../utils";

/** 列表查询 */
export const getRoleList = (params?: object) => {
  return http.request<any>("get", baseUrlApi("/role/page"), {
    params: filerEmptyVal(params)
  });
};

/** 新增 */
export const addRole = (data?: object) => {
  return http.request<any>("post", baseUrlApi("/role/add"), {
    data: filerEmptyVal(data)
  });
};

/** 修改 */
export const upRole = (data?: object) => {
  return http.request<any>("post", baseUrlApi("/role/update"), { data });
};

/** 删除 */
export const delRole = (treeId?: number) => {
  return http.request<any>("post", baseUrlApi("/role/delete?id=" + treeId));
};
